package com.lovo.project2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project2.bean.ClientBean;
import com.lovo.project2.mapper.IClientBeanMapper;
import com.lovo.project2.service.IClientBeanService;
import org.springframework.stereotype.Service;

@Service
public class ClientBeanServiceImpl extends ServiceImpl<IClientBeanMapper, ClientBean> implements IClientBeanService {
    @Override
    public IPage<ClientBean> queryListBynameByscope(IPage iPage, String name, String scope) {

        QueryWrapper queryWrapper=new QueryWrapper();
        if (name!=null&&!"".equals(name)){
            queryWrapper.like("name",name);
            System.out.println("!!!!!!!!!");
        }
        if (scope!=null&&!"".equals(scope)){
            queryWrapper.like("scope",scope);
        }
IPage<ClientBean> iPage1=baseMapper.selectPage(iPage,queryWrapper);


        return iPage1 ;
    }

    @Override
    public ClientBean queryClientBeanById(int id) {



        return baseMapper.selectById(id);
    }

    @Override
    public void updateClientBean(ClientBean clientBean) {

        baseMapper.updateById(clientBean);
    }

    @Override
    public void addClientBean(ClientBean clientBean) {
baseMapper.insert(clientBean);
    }
}
